class Python:
    member = []
    def __init__(self,phone,name):
        self.phone = phone
        self.name = name

    def add(self):
        dict_information = {'phone':self.phone,'name':self.name}
        Python.member.append(dict_information)
#
# p = Python('NO.001','刘冲')
# p.add()
# print(p.member)


with open('name.txt','rt',encoding = 'utf8') as f:
    listf = f.readlines()
    # No_ = []
    #
    # for num in range(1,35):
    #     N = 'No.00{}'.format(num)
    #     No_.append(N)
    #
    # for i in range(len(listf)):
    #     p = Python(No_[i],listf[i])
    #     p.add()
    # print(p.member)
    #
    # for i in p.member:
    #     print()
    # for i in listf:
    #     print(i)


# 思路 readline --》 得到1行数据 --》字典 --》append 到list中
s1 = 'abc%.2f'%1.414
#       abc1.41
s2 = 'abc%.4d'%33
#      abc0033
print(s1)
print(s2)

f = open('name.txt','r',encoding='utf8')
res = f.readline()
count = 1
list1 = []
while res:

    dict1 = {}
    dict1['python'] = 'NO.%.4d'%count
    dict1['name'] = res.strip()
    list1.append(dict1)
    res = f.readline()
    count += 1




f.close()
print(list1)




















